#!/bin/bash
# Copyright (c) 2017 ~ 2025, the original author wangl.sir individual Inc,
# All rights reserved. Contact us wanglsir
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# @see https://yq.aliyun.com/articles/741365
# @see https://www.jianshu.com/p/f6437e914584
# @see https://wang4ever.lofter.com/post/1cca927e_1c752cc99
export MYSQL_HOME=/usr/lib/mysql-current
export MYSQL_VERSION="$(echo $($MYSQL_HOME/bin/mysqld --version|awk -F mysqld '{print $2}'|awk -F '(' '{print $1}'))"
export MYSQL_USER="mysql"
export MYSQL_GROUP="mysql"
export MYSQL_PLUGIN_DIR="${MYSQL_HOME}/lib/plugin"
export MYSQL_CONF_FILE="/etc/my.cnf"
export MYSQL_WORKSPACE_DIR="/mnt/disk1/mysql"
export MYSQL_DATA_DIR="${MYSQL_WORKSPACE_DIR}/data"
export MYSQL_BINLOG="${MYSQL_DATA_DIR}/binlog"
export MYSQL_LOG_DIR='/mnt/disk1/log/mysql'
export MYSQL_LOG_ERR="${MYSQL_LOG_DIR}/mysqld.err"
export MYSQL_PID_FILE="${MYSQL_WORKSPACE_DIR}/mysqld.pid"
export MYSQL_SOCKET="${MYSQL_WORKSPACE_DIR}/mysqld.sock"
export PATH="$PATH:$MYSQL_HOME/bin:"